package com.itheima.homework.Work10;

public class Demo10 {
    public static void main(String[] args) {
        String str = "Java语言是面向对象的，Java语言是健壮的，Java语言是安全的，Java是高性能的，Java语言是跨平台的";
        int count = 0;

        while (str.contains("Java")) {
            String str1 = "Java";
            int i = str.indexOf(str1);
           str= str.substring(i + "Java".length());
            count++;
        }
        System.out.println("Java出现次数为:"+count);
    }
}
